﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeBehind="ManualAllocation.aspx.cs" Inherits="WMS6.Web.Outbound.ManualAllocation" meta:resourcekey="Page" %>
<%@ Register src="../UserControls/Pager.ascx" tagname="Pager" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>ManualAllocation</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <script src="../Js/Verification.js" type="text/javascript"></script>  
    <script src="../Js/util.js" id="js" type="text/javascript"></script>
    <script src="../Js/InitPage.js" type="text/javascript"></script>  
    <script src="../Js/checkbox.js" type="text/javascript"></script>
    <base target="_self" />   
    <script type="text/javascript">
       
        //初始化页面
        window.onload = function(){
            var actionID = window.dialogArguments;
            if(actionID != "" && actionID != null)
            {
                //document.getElementById("hdnActionID").value = actionID;
                var array = actionID.split(',');
                initQueryPage(array[0],array[1]);
            }
            else
            {
                initDetailPage();
            }
        }
        
        //检查用户输入数量是否正确
        function checkQty()
        {
            if(document.getElementById('txtQty') != null)
            {
                var originQty = document.getElementById("hdnQty").value;    //原始数量
                var inputQty =  document.getElementById("txtQty").value;    //用户输入数量
                if(parseFloat(inputQty) > parseFloat(originQty) || parseFloat(inputQty) <= 0)
                {
                    document.getElementById("lblMsg").innerText = "请输入正确的分配数量!";
                    document.getElementById("lblMsg").style.display = "block";   
                    document.getElementById("txtQty").value = originQty;          
                    document.getElementById("txtQty").focus();
                    return false;
                }
                else
                {                   
                    return true;               
                } 
            }
        }
        
        //弹出窗口选择承运商
        function selectLoc()
        {
            var rtnValue = popModalWindow('../Configuration/LocationQuery.aspx?action=txtLocID','dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if(rtnValue != null && rtnValue.toString() != "")
            {
                document.getElementById("txtLocID").focus();
                document.getElementById("txtLocID").value = rtnValue;
            }
        }
        
        //Textbox回车事件
        function EnterTextBox(obj)
        {
             if(event.keyCode == 13 && document.all[obj].value != "")
             {
                 event.keyCode = 9;
                 event.returnValue = false;
                 document.getElementById("btnPutAway").click();
             }
        }
        
        function setTab2(name,cursel,n){
 		    for(i=1;i<=n;i++){
     		
  		    var text=document.getElementById(name+i);
  		    var con=document.getElementById("con_"+name+"_"+i);
      		
  		    var mainDiv = document.getElementById("divMM"+i);
  		    var divL = document.getElementById("divLL"+i);
 		    var divR = document.getElementById("divRR"+i);
     		
  		    mainDiv.className=i==cursel?"tabLabelCont tabCur": "tabLabelCont tabCur_1";
  		    divL.className=i==cursel?"tabL": "tabL_1";
  		    divR.className=i==cursel?"tabR": "tabR_1";
  		    text.className=i==cursel?"hover":"navigationlabel";
  		    con.style.display=i==cursel?"block":"none";
  		    
  		    if(cursel =="1")
  		    {
  		        document.getElementById("hdnCurOption").value = "1";
  		    }
  		    else
  		    {
  		        document.getElementById("hdnCurOption").value = "2";
  		    }
         }
        }
        
        //根据库存进行分配
        function allocatedByInv(allocatedqty)
        {
            var qty = document.getElementById("hdnQty").value;              //需分配的总数量
            var remainQty = document.getElementById("hdnRemainQty").value;  //需分配的总剩余数量
            
            var availableQty = allocatedqty.parentNode.parentNode.childNodes[8].innerText;          //该行的剩余可用数量
            var totalAvailableQty = allocatedqty.parentNode.parentNode.childNodes[11].innerText;    //该行的总可用数量
            
            var isChecked = allocatedqty.parentNode.parentNode.childNodes[0].childNodes[0].checked; //判断该行是否选中
            
            if(isChecked)
            {
                //如果该行的可用数量>=要分配的剩余数量,则用该行的可用数量填满
                if(availableQty >= remainQty)
                {
                    
                }
                allocatedqty.parentNode.parentNode.childNodes[8].childNodes[0].innerText = "123";
            }
            else
            {
                
            }
        }
        
        function checkAvailableQty(obj)
        {
            if(parseFloat(obj.parentNode.parentNode.childNodes[2].innerText)==0 || parseFloat(obj.parentNode.parentNode.childNodes[2].innerText)<obj.value)
            {
                //如果用户输入的数量大于可用数量
                document.getElementById("lblMsg").innerText = "请输入正确的分配数量!";
                obj.innerText = "";
                obj.focus();
            }
//            else
//            {
//                if(document.getElementById("lblMsg").innerText != "")
//                {
//                    document.getElementById("lblMsg").innerText = "";
//                }
//                
//                //取到订单行的已分配数量
//                var totalInputQty = parseFloat(document.getElementById("hdnAllocatedQty").value);
//                var isEnough = false;
//                for(var i=1; i<obj.parentNode.parentNode.parentNode.childNodes.length; i++)
//                {
//                    if(!isEnough)
//                    {
//                        if(obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].value != "" && parseFloat(obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value)>0)
//                        {
//                            if(totalInputQty + parseFloat(obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value) > document.getElementById("txtOrderQty").value)
//                            {
//                                 var remain = parseFloat(document.getElementById("txtOrderQty").value) - totalInputQty;
//                                 obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value = parseFloat(obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value) - remain;
//                                 totalInputQty += remain;
//                                 isEnough = true;
//                            }
//                            else if(totalInputQty + parseFloat(obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value) == document.getElementById("txtOrderQty").value)
//                            {
//                                totalInputQty += parseFloat(obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value);
//                                isEnough = true;
//                            }
//                            else
//                            {
//                                totalInputQty += parseFloat(obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value);
//                            }
//                        }
//                    }
//                    else
//                    {
//                        obj.parentNode.parentNode.parentNode.childNodes[i].childNodes[3].childNodes[0].value = "";
//                        break;
//                    }
//                }
//                document.getElementById("txtAllocatedQty").value = totalInputQty.toString();
//                document.getElementById("txtPendingAllocQty").value = (parseFloat(document.getElementById("txtOrderQty").value) - parseFloat(document.getElementById("txtAllocatedQty").value)).toString();
//            }
        }
        
        //显示/隐藏批次属性查询条件
        function showQueryDiv()
        {
            if(document.getElementById("query").style.display == "none")
            {
                document.getElementById("query").style.display = "block";
                document.getElementById("queryImg").src="../Images/b-.gif";
                document.getElementById("queryImg").alt="close";
            }
            else
            {
                document.getElementById("query").style.display = "none";
                document.getElementById("queryImg").src="../Images/bigaddition.gif";
                document.getElementById("queryImg").alt="open";
            }
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom"><asp:Label ID="lblManualPA" runat="server" 
                            CssClass="label_header" Text="手动分配" meta:resourcekey="lblManualPA"></asp:Label></td>
                    <td><asp:Button ID="btnGoBack" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnCancel%>" 
                            AccessKey="b" onclick="btnGoBack_Click" /></td>
                    <td><asp:Button ID="btnSave" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnSave%>" 
                            AccessKey="s" onclick="btnSave_Click"  /></td>
                </tr>
            </table>
        </div>
        
        <div>
            <asp:Label ID="lblMsg" runat="server" CssClass="label_message" 
                meta:resourcekey="lblMsg"></asp:Label>
        </div>
        
        <div id="div1" style="width:98%; height:21px; margin-left:10px; margin-top:10px; margin-bottom:0px;">
            <div style="float: left; width: 8px;">
                <div class="tabL" id="divLL1"></div>
            </div>
            <div style="float:left;" class="tabLabelCont tabCur" onclick="setTab2('two',1,2)" id="divMM1">
                <asp:Label ID="two1" CssClass="hover" runat="server" 
                    meta:resourcekey="two1">按货位拣货</asp:Label></div>
            <div style="float: left; margin-right: 2px;">
                <div class="tabR" id="divRR1"></div>
            </div>
            <div style="float: left; width: 8px;">
                <div class="tabL_1" id="divLL2"></div>
            </div>
            <div style="float:left;" class="tabLabelCont tabCur_1" onclick="setTab2('two',2,2);" id="divMM2">
                <asp:Label ID="two2" CssClass="navigationlabel" runat="server" 
                    meta:resourcekey="two2">按库存拣货</asp:Label></div>
            <div style="float: left; margin-right: 2px;">
                <div class="tabR_1" id="divRR2"></div>
            </div>
       </div>
       
       <div id="div_content2" style="width:810px;">
            <div id="con_two_1" style="display:block;">
                <table style="width:800px">
                <tr>
                    <td style="width:540px;">
                        <div id="div_menu" style="width:540px;">
                            <div style="float: left; width: 8px;">
                                <div class="tabL" id="divL1"></div>
                            </div>
                            <div style="float:left;" class="tabLabelCont tabCur" onclick="setTab('one',1,3)" id="divM1">
                                <asp:Label ID="one1" CssClass="hover" runat="server" 
                                    meta:resourcekey="one1">按照货位</asp:Label></div>
                            <div style="float: left; margin-right: 2px;">
                                <div class="tabR" id="divR1"></div>
                            </div>
                            
                            <div style="float: left; width: 8px;">
                                <div class="tabL_1" id="divL2"></div>
                            </div>
                            <div style="float:left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,3)" id="divM2">
                                <asp:Label ID="one2" CssClass="navigationlabel" runat="server" 
                                    meta:resourcekey="one2">按照排列层</asp:Label></div>
                            <div style="float: left; margin-right: 2px;">
                                <div class="tabR_1" id="divR2"></div>
                            </div>
                            
                            <div style="float: left; width: 8px;">
                                <div class="tabL_1" id="divL3"></div>
                            </div>
                            <div style="float:left;" class="tabLabelCont tabCur_1" onclick="setTab('one',3,3)" id="divM3">
                                <asp:Label ID="one3" CssClass="navigationlabel" runat="server" 
                                    meta:resourcekey="one3">批量拣货</asp:Label></div>
                            <div style="float: left; margin-right: 2px;">
                                <div class="tabR_1" id="divR3"></div>
                            </div>
                           
                        </div>
                        <div id="div_content" style="width:550px; height:85px;">
                             <div id="con_one_1" style="display: block; width:550px;">
                                 <table width="540px" style="display: block; margin-left: 10px; margin-top: 10px;">
                                     <tr>
                                         <td width="180">
                                             <asp:Label ID="lblLocID" runat="server" CssClass="label" Text="货位" 
                                                 meta:resourcekey="lblLocID"></asp:Label><font color="red">*</font>
                                         </td>
                                         <td width="180">
                                             &nbsp;</td>
                                         <td width="180">
                                             &nbsp;</td>
                                     </tr>
                                     <tr>
                                         <td>
                                             <asp:TextBox ID="txtLocID" runat="server" CssClass="textbox" MaxLength="20" 
                                                 onkeypress="return EnterTextBox('txtLocID');" onkeyUp="SearchDataAjax(this,'LOC','txtLocID');return false;"
                                                        onblur="LoseFocus();return false;" onchange="LoseFocus();"
                                                 meta:resourcekey="txtLocID"></asp:TextBox>
                                         </td>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             &nbsp;</td>
                                     </tr>
                                     <tr style=" margin-top:10px; ">
                                         <td width="360" colspan="2">
                                             <asp:Label ID="lblFormatExample" runat="server" CssClass="label" Text="格式:" 
                                                 meta:resourcekey="lblFormatExample"></asp:Label>
                                         </td>
                                         <td width="180">
                                             &nbsp;</td>
                                     </tr>
                                 </table>
                             </div>
                             
                             <div id="con_one_2" style="display: none; width:550px;">
                                 <table width="540px" style="display: block; margin-left: 10px; margin-top: 10px;">
                                     <tr>
                                         <td></td>
                                         <td></td>
                                         <td></td>
                                         <td></td>
                                     </tr>
                                 </table>
                             </div>
                             
                             <div id="con_one_3" style="display: none; width:550px;">
                             </div>
                             
                        </div>
                    </td>
                    <td style="width:230px;" valign="bottom">
                        <table style="width:100%; height:100%; margin-left:10px;">
                            <tr>
                                <td><asp:Label ID="lblSkuID" runat="server" CssClass="label" Text="货品代码" 
                                        meta:resourcekey="lblSkuID"></asp:Label></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><asp:TextBox ID="txtSkuID" runat="server" CssClass="textbox" MaxLength="30" 
                                        meta:resourcekey="txtSkuID"></asp:TextBox></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><asp:Label ID="lblQty" runat="server" CssClass="label" Text="数量" 
                                        meta:resourcekey="lblQty"></asp:Label></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><asp:TextBox ID="txtQty" runat="server" CssClass="textbox" MaxLength="30"  
                                        Width="100px" 
                                        onkeyup="value=value.replace(/[^\d\.]/g,'');" 
                                        onblur="value=value.replace(/[^\d\.]/g,'');checkQty();"
                                        meta:resourcekey="txtQty"></asp:TextBox>
                                    <asp:Label ID="lblUomID" runat="server" CssClass="label" Width="50px" 
                                        meta:resourcekey="lblUomID"></asp:Label>
                                </td>
                                <td><asp:Button ID="btnPutAway" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnAllocate%>"  
                                        onclick="btnPutAway_Click" /></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr style="height:10px;"><td></td></tr>
                <tr >
                    <td colspan="2">
                        <table style="margin-left:10px;">
                            <tr>
                                <td>
                                    <asp:GridView ID="gvAllocation" runat="server" AutoGenerateColumns="False" 
                                        CssClass="gridview" onrowdatabound="gvAllocation_RowDataBound" AllowPaging="True"  
                                        Width="780px" onrowdeleting="gvAllocation_RowDeleting" 
                                        onpageindexchanging="gvAllocation_PageIndexChanging" 
                                        meta:resourcekey="gvAllocation" >
                                     <FooterStyle CssClass="GridViewFooterStyle" />
                                     <RowStyle CssClass="GridViewRowStyle" />
                                     <HeaderStyle CssClass="GridViewHeaderStyle" />
                                     <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                     <Columns>
                                         <asp:TemplateField HeaderText="取消" FooterText="取消" 
                                             meta:resourcekey="Cancel">
                                             <ItemTemplate>
                                                 <asp:LinkButton ID="lnkbtnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                                     Text="&lt;img 
                                                     src=&quot;../Images/delete.gif&quot; class=&quot;img&quot; style=&quot;border:none 0px blue;&quot; 
                                                     alt=&quot;delete&quot; __designer:mapid=&quot;476&quot;/&gt;" meta:resourcekey="lnkbtnDelete"></asp:LinkButton>
                                             </ItemTemplate>
                                             <ItemStyle CssClass="GridViewRowWidth_50" HorizontalAlign="Center"/>
                                         </asp:TemplateField>
                                        <asp:BoundField HeaderText="序号" FooterText="序号" 
                                             meta:resourcekey="No">
                                             <ItemStyle CssClass="GridViewRowWidth_40" />
                                         </asp:BoundField>
                                         <asp:BoundField DataField="Loc" HeaderText="货位" FooterText="货位" 
                                             SortExpression="Loc" meta:resourcekey="Loc">
                                             <ItemStyle CssClass="GridViewRowWidth_150" />
                                         </asp:BoundField>
                                         <asp:TemplateField FooterText="分配数量" HeaderText="分配数量" SortExpression="Qty" 
                                             meta:resourcekey="Qty">
                                            <ItemTemplate>
                                                <asp:Label ID="lblQty" runat="server" 
                                                    Text='<%# GetPreferenceDigit(Eval("Qty").ToString()) %>' 
                                                    meta:resourcekey="lblQtyResource2"></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_150" />
                                         </asp:TemplateField>
                                         <asp:BoundField DataField="UomID" HeaderText="单位" FooterText="单位" 
                                             SortExpression="UomID" meta:resourcekey="UomID">
                                             <ItemStyle CssClass="GridViewRowWidth_150" />
                                         </asp:BoundField>                                    
                                     </Columns>
                                 </asp:GridView>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            </div>
            <div id="con_two_2" style="display:none;">
                <table style="display: block; margin-left: 10px; margin-top: 10px; width:720px; height:400px;">
                     <tr style="height:30px;">
                         <td>
                            <table style="width:720px">
                                <tr>
                                    <td><asp:Label ID="lblSkuID2" Text="货品代码" runat="server" CssClass="label" ></asp:Label></td>
                                    <td><asp:Label ID="lblOrderQty" Text="订货数量" runat="server" CssClass="label" ></asp:Label></td>
                                    <td><asp:Label ID="lblAllocatedQty" Text="已分配数量" runat="server" CssClass="label" ></asp:Label></td>
                                    <td><asp:Label ID="lblPendingAllocQty" Text="待分配数量" runat="server" CssClass="label" ></asp:Label></td>
                                </tr>
                                <tr>
                                    <td><asp:TextBox ID="txtSkuID2" runat="server" CssClass="textbox" Enabled="false" ></asp:TextBox></td>
                                    <td><asp:TextBox ID="txtOrderQty" runat="server" CssClass="textbox" Enabled="false" ></asp:TextBox></td>
                                    <td><asp:TextBox ID="txtAllocatedQty" runat="server" CssClass="textbox" Enabled="false" ></asp:TextBox></td>
                                    <td><asp:TextBox ID="txtPendingAllocQty" runat="server" CssClass="textbox" Enabled="false" ></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td><asp:Label ID="lblSearchLocID" Text="货位" runat="server" CssClass="label" ></asp:Label></td>
                                    <td><asp:Label ID="lblReceiptID" Text="入库单号" runat="server" CssClass="label" ></asp:Label></td>
                                    <td><asp:Label ID="lblExternalReceiptID" Text="外部入库单号" runat="server" CssClass="label" ></asp:Label></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td><asp:TextBox ID="txtSearchLocID" runat="server" CssClass="textbox" ></asp:TextBox></td>
                                    <td><asp:TextBox ID="txtReceiptID" runat="server" CssClass="textbox" ></asp:TextBox></td>
                                    <td><asp:TextBox ID="txtExternalReceiptID" runat="server" CssClass="textbox" ></asp:TextBox></td>
                                    <td>
                                        <table>
                                            <tr>
                                                <td width="40%">
                                                    <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:ButtonResource,btnSearch%>"
                                                        OnClick="btnSearch_Click" />
                                                </td>
                                                <td width="30%">
                                                    <asp:RadioButton GroupName="search" ID="rdbtnSame" runat="server" Text="精确" Checked="true" />
                                                </td>
                                                <td width="30%">
                                                    <asp:RadioButton GroupName="search" ID="rdbtnLike" runat="server" Text="模糊" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </table>
                         </td>
                     </tr>
                     <tr >
                        <td>
                            <div><img id="queryImg" src="../Images/bigaddition.gif" alt="open" onclick="showQueryDiv();" /></div>
                            <div id="query" style="display:none;">
                                <table style="width:720px">
                                    <tr>
                                        <td><asp:Label ID="lblExternalLot" Text="外部批号" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblProduceDate" Text="生产日期" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblExpireDate" Text="失效日期" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblReceiptDate" Text="入库日期" runat="server" CssClass="label" ></asp:Label></td>
                                    </tr>
                                    <tr>
                                        <td><asp:TextBox ID="txtExternalLot" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtProduceDate" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtExpireDate" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtReceiptDate" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td><asp:Label ID="lblVendorID" Text="供应商代码" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr01" Text="批次属性01" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr02" Text="批次属性02" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr03" Text="批次属性03" runat="server" CssClass="label" ></asp:Label></td>
                                    </tr>
                                    <tr>
                                        <td><asp:TextBox ID="txtVendorID" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr01" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr02" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr03" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td><asp:Label ID="lblLotAttr04" Text="批次属性04" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr05" Text="批次属性05" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr06" Text="批次属性06" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr07" Text="批次属性07" runat="server" CssClass="label" ></asp:Label></td>
                                    </tr>
                                    <tr>
                                        <td><asp:TextBox ID="txtLotAttr04" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr05" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr06" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr07" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td><asp:Label ID="lblLotAttr08" Text="批次属性08" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr09" Text="批次属性09" runat="server" CssClass="label" ></asp:Label></td>
                                        <td><asp:Label ID="lblLotAttr10" Text="批次属性10" runat="server" CssClass="label" ></asp:Label></td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td><asp:TextBox ID="txtLotAttr08" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr09" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td><asp:TextBox ID="txtLotAttr10" runat="server" CssClass="textbox" Enabled="true" ></asp:TextBox></td>
                                        <td></td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                     </tr>
                     <tr style="height:360px;">
                         <td valign="top">
                             <div style="margin-top:10px; width:790px; height:335px; overflow-x:scroll; overflow-y:auto;">
                                <asp:GridView ID="gvInvLotLocLpn" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                                    OnRowDataBound="gvInvLotLocLpn_RowDataBound"
                                    OnSorting="gvInvLotLocLpn_Sorting" CssClass="gridview" 
                                     DataKeyNames="LOC,LOT,LPN_ID,SKU_ID,DESCR,AVAILABLE_QTY,PACK_ID,HOLD_STATUS" 
                                     Width="2150px" meta:resourcekey="gvInvLotLocLpn">
                                    <FooterStyle CssClass="GridViewFooterStyle" />
                                    <RowStyle CssClass="GridViewRowStyle" />
                                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                    <Columns>
                                        <asp:BoundField HeaderText="序号" FooterText="序号" 
                                            meta:resourcekey="No">
                                            <ItemStyle CssClass="GridViewRowWidth_40" />
                                        </asp:BoundField>
                                        <%--<asp:TemplateField meta:resourcekey="TemplateFieldResource3" >
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" 
                                                    onclick="selectAll(this,'gvInvLotLocLpn');" 
                                                    meta:resourcekey="CheckBox1" /> 
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chbSelect" runat="server" onclick="allocatedByInv(this);" 
                                                    meta:resourcekey="chbSelect" />
                                            </ItemTemplate>
                                            <FooterTemplate>
                                                <asp:CheckBox ID="CheckBox2" runat="server" 
                                                    onclick="selectAll(this,'gvInvLotLocLpn');" 
                                                    meta:resourcekey="CheckBox2" /> 
                                            </FooterTemplate>
                                            <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40"/>
                                            <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_40"/>
                                        </asp:TemplateField> --%>
                                        <asp:BoundField DataField="LOC" HeaderText="货位" FooterText="货位" 
                                            SortExpression="LOC" meta:resourcekey="LOC">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:TemplateField FooterText="数量" HeaderText="数量" SortExpression="AVAILABLE_QTY">
                                            <ItemTemplate>
                                                <asp:Label ID="lblAvailableQTY" runat="server" 
                                                    Text='<%# GetPreferenceDigit(Eval("AVAILABLE_QTY").ToString()) %>' 
                                                    meta:resourcekey="lblAvailableQTY"></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:TemplateField>
                                        <asp:TemplateField FooterText="分配数量" HeaderText="分配数量" 
                                            meta:resourcekey="AllocatedQty">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtAllocatedQty" runat="server" 
                                                    onkeyup="value=value.replace(/[^\d\.]/g,'');" 
                                                    onblur="value=value.replace(/[^\d\.]/g,'');checkAvailableQty(this);" Width="98px"></asp:TextBox>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:TemplateField>
                                        <%--<asp:BoundField DataField="OWNER_ID" HeaderText="货主" FooterText="货主" SortExpression="OWNER_ID">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="SKU_ID" HeaderText="货品" FooterText="货品" SortExpression="SKU_ID">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>--%>
                                        <asp:BoundField DataField="LOT" HeaderText="批次号" FooterText="批次号" SortExpression="LOT">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LPN_ID" HeaderText="LPN" FooterText="LPN" SortExpression="LPN_ID">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="SKU_PROPERTY" HeaderText="货品属性" FooterText="货品属性" 
                                            SortExpression="SKU_PROPERTY" meta:resourcekey="SKU_PROPERTY">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <%--<asp:BoundField DataField="HOLD_STATUS" HeaderText="冻结状态" FooterText="冻结状态" SortExpression="HOLD_STATUS">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>--%>
                                        <asp:BoundField DataField="EXTERNAL_LOT" HeaderText="外部批号" FooterText="外部批号" 
                                            SortExpression="EXTERNAL_LOT" meta:resourcekey="EXTERNAL_LOT">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:TemplateField FooterText="入库日期" HeaderText="入库日期" 
                                            SortExpression="RECEIPT_DATE" meta:resourcekey="RECEIPT_DATE">
                                            <ItemTemplate>
                                                <asp:Label ID="lblRECEIPT_DATE" runat="server" 
                                                    Text='<%# GetPreferenceShortDate(Eval("RECEIPT_DATE").ToString()) %>' ></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:TemplateField>
                                        <asp:TemplateField FooterText="生产日期" HeaderText="生产日期" 
                                            SortExpression="PRODUCE_DATE" meta:resourcekey="PRODUCE_DATE">
                                            <ItemTemplate>
                                                <asp:Label ID="lblPRODUCE_DATE" runat="server" 
                                                    Text='<%# GetPreferenceShortDate(Eval("PRODUCE_DATE").ToString()) %>' 
                                                    meta:resourcekey="lblPRODUCE_DATE"></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:TemplateField>
                                        <asp:TemplateField FooterText="失效日期" HeaderText="失效日期" 
                                            SortExpression="EXPIRY_DATE" meta:resourcekey="EXPIRY_DATE">
                                            <ItemTemplate>
                                                <asp:Label ID="lblEXPIRY_DATE" runat="server" 
                                                    Text='<%# GetPreferenceShortDate(Eval("EXPIRY_DATE").ToString()) %>' 
                                                    meta:resourcekey="lblEXPIRY_DATE"></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="VENDOR_NAME" HeaderText="供应商名称" FooterText="供应商名称" 
                                            SortExpression="VENDOR_NAME" meta:resourcekey="VENDOR_NAME">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR01" HeaderText="批次属性01" FooterText="批次属性01" 
                                            SortExpression="LOT_ATTR01" meta:resourcekey="LOT_ATTR01">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR02" HeaderText="批次属性02" FooterText="批次属性02" 
                                            SortExpression="LOT_ATTR02" meta:resourcekey="LOT_ATTR02">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR03" HeaderText="批次属性03" FooterText="批次属性03" 
                                            SortExpression="LOT_ATTR03" meta:resourcekey="LOT_ATTR03">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR04" HeaderText="批次属性04" FooterText="批次属性04" 
                                            SortExpression="LOT_ATTR04" meta:resourcekey="LOT_ATTR04">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR05" HeaderText="批次属性05" FooterText="批次属性05" 
                                            SortExpression="LOT_ATTR05" meta:resourcekey="LOT_ATTR05">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR06" HeaderText="批次属性06" FooterText="批次属性06" 
                                            SortExpression="LOT_ATTR06" meta:resourcekey="LOT_ATTR06">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR07" HeaderText="批次属性07" FooterText="批次属性07" 
                                            SortExpression="LOT_ATTR07" meta:resourcekey="LOT_ATTR07">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR08" HeaderText="批次属性08" FooterText="批次属性08" 
                                            SortExpression="LOT_ATTR08" meta:resourcekey="LOT_ATTR08">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="LOT_ATTR10" HeaderText="批次属性10" FooterText="批次属性10" 
                                            SortExpression="LOT_ATTR10" meta:resourcekey="LOT_ATTR10">
                                            <ItemStyle CssClass="GridViewRowWidth_100" />
                                        </asp:BoundField>
                                    </Columns>
                                </asp:GridView>
                                <div style="height:10px"></div>
                                <div style="width:92%;">
                                    <uc1:Pager ID="PagerFooter" runat="server"  OnFirst="btnFirst_Click" OnPrevious="btnPrevious_Click" OnNext="btnNext_Click" OnLast="btnLast_Click" OnGoTo="GoTo_Click"/>
                                </div>
                                </div>    
                         </td>
                     </tr>
                 </table>
            </div>
        </div>        
        <input type="hidden" id="hdnQty" runat="server" />
        <input type="hidden" id="hdnOriginQty" runat="server" />
        <input type="hidden" id="hdnRemainQty" runat="server" />
        <input type="hidden" id="hdnAllocatedQty" runat="server" />
        <input type="hidden" id="hdnRtnValue" runat="server" />
        <input type="hidden" id="hdnCurOption" runat="server" value="1" />
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    <!--
    window.returnValue = document.getElementById("hdnRtnValue").value;
    if(window.returnValue != "")
    {
        window.close();
    }
   //-->
</script>
<script type="text/javascript">
    <!--
    if(document.getElementById("txtLocID") != null)
    {
        var tempValue = document.getElementById("txtLocID").value;
        document.getElementById("txtLocID").value = "";
        if(document.getElementById("hdnCurOption").value == "1")
        {
            if(document.getElementById("txtLocID") != null)
            {
                document.getElementById("txtLocID").focus();
            }
        }
        document.getElementById("txtLocID").value = tempValue;
    }
   //-->
</script>
